#include "widget.h"

#include <QApplication>
#include <QTextCodec>
#include <locale>
#include <QMainWindow>
#include "sceneWidget.h"
#include <QtOSGWidget.h>
#include "QOSGViewerWidget.h"

//int main(int argc, char* argv[]) {
//#ifdef _WIN32
//	_putenv_s("GDAL_DATA", "gdal_data/");
//	_putenv_s("PROJ_LIB", "proj_data/");
//#endif // _WIN32
//	osgEarth::initialize();
//
//	//  QTextCodec::setCodecForLocale(QTextCodec::codecForName("System"));
//	//  QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
//	//  std::locale::global(std::locale(""));
//
//	QApplication a(argc, argv);
//	Widget w;
//	w.show();
//	return a.exec();
//}

int main(int argc, char** argv) {
#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
	QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
#else
	qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1"));
#endif
	osgEarth::initialize();

	QApplication qapp(argc, argv);
	QMainWindow window;
	//sceneWidget* widget = new sceneWidget(&window);

	Widget* widget = new Widget(&window);
	//QOSGViewerWidget* widget = new QOSGViewerWidget(&window);
	window.setCentralWidget(widget);
	window.show();

	return qapp.exec();
}